<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\common\model;


/**
 * Game模型
 */
class PlanUserThrow extends ModelBase
{

    protected $insert = ['create_time'];




    /**
     * 时间自动完成
     */
    public function setCreateTimeAttr()
    {

        return TIME_NOW;
    }

    /**
     * 获取状态信息
     */
    public function getContentAttr($value){

        return json_decode($value,true);
    }


    /**
     * logo
     */
    public function getImageAttr()
    {
        if($this->cover_id>0){
            return get_picture_url($this->cover_id,false);
        }
        return '';

    }

    /***
     * 获取倍数
     */

    public function get_mult($key){

        $content=$this->content;
        return $content[$key-1]['multiple'];
    }

    /***
     * 获取局数
     */

    public function get_game($key,$is_reward){
        $content=$this->content;
        if($is_reward==1){
            //中后
            return $content[$key-1]['bureaus'];
        }else{
            //不中
            return $content[$key-1]['bureaus_two'];
        }

    }


}
